<?PHP
  $template = new Template();
  $template->load("plugins");
  $plugins = new PluginList();
  $plugins->loadAll();
  foreach($plugins->plugins as $plugin){
    $index = $template->add_loop_item("PLUGINS");
    if($_GET['activate'] == $plugin->path){
	  $plugin->activate();
    }
	elseif($_GET['deactivate'] == $plugin->path){
	  $plugin->deactivate();
    }
    $template->assign_loop_var("PLUGINS",$index,"NAME",$plugin->name);
    $template->assign_loop_var("PLUGINS",$index,"DESCRIPTION",$plugin->description);
    $template->assign_loop_var("PLUGINS",$index,"VERSION",$plugin->version);
    $template->assign_loop_var("PLUGINS",$index,"AUTHORLINK",$plugin->authorLink);
    $template->assign_loop_var("PLUGINS",$index,"AUTHORNAME",$plugin->authorName);
    if($plugin->isActivated()){
      $template->assign_loop_var("PLUGINS",$index,"ACTIVATIONLINK","<a href=\"/admin/index.php?page=plugins&deactivate=".urlencode($plugin->path)."\">Deaktvieren</a>");
    }
    else{
      $template->assign_loop_var("PLUGINS",$index,"ACTIVATIONLINK","<a href=\"/admin/index.php?page=plugins&activate=".urlencode($plugin->path)."\">Aktvieren</a>");
    }
  }
  $template->output();
?>